﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <title>Please wait...</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
    <meta http-equiv="Pragma" content="no-cache" />

    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

    <link rel="icon" type="image/x-icon" href="">

    <style type="text/css">
        @font-face {
          font-family: 'Open Sans';
          font-style: normal;
          font-weight: 400;
          src: local('Open Sans'), local('OpenSans'), url(https://fonts.gstatic.com/s/opensans/v13/cJZKeOuBrn4kERxqtaUH3VtXRa8TVwTICgirnJhmVJw.woff2) format('woff2');
          unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
        }
        @font-face {
          font-family: 'Open Sans';
          font-style: normal;
          font-weight: 700;
          src: local('Open Sans Bold'), local('OpenSans-Bold'), url(https://fonts.gstatic.com/s/opensans/v13/k3k702ZOKiLJc3WVjuplzOgdm0LZdjqr5-oayXSOefg.woff2) format('woff2');
          unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
        }
    </style>

    <style type="text/css">
        body {
            background-color: white;
            color: #333333;
            font: 12px "Open Sans",sans-serif;
            height: 100%;
            margin: 0;
            padding: 0;
            text-decoration: none;
        }
        .main-content {
            height: 100%;
        }
        div {
            margin: 0;
            padding: 0;
        }
        #studioPageContent {
            min-height: 100%;
            min-width: 1024px;
            position: relative;
        }
        .mainPageLayout {
            height: auto;
            margin: 0 auto;
            min-width: 959px;
            overflow-x: hidden;
            padding: 24px 24px 0;
            position: static;
            text-align: left;
            width: auto;
        }
        .studio-top-panel {
            background: #0f4071 none repeat scroll 0 0;
            color: #c5c5c5;
            height: 44px;
            padding-top: 4px;
            z-index: 1;
        }
        .studio-top-button-hidden-tabs {
            background: #0f4071 none repeat scroll 0 0;
            
        }
        .studio-top-panel > ul {
            list-style: outside none none;
            margin: 0;
            padding: 0;
        }
        .studio-top-panel .studio-top-logo {
            margin: 8px 24px 0 0;
        }
        .mainPageTable {
            float: none;
            height: 100%;
            overflow: auto;
            width: 100%;
        }
        .mainPageTable .mainPageContent {
            padding-bottom: 24px;
            vertical-align: top;
        }
        .startup-loading-cnt {
            margin-top: 7%;
            text-align: center;
        }
        .startup-loading-cnt .loader-page {
            left: auto;
            margin: 0 auto;
            position: relative;
            top: auto;
        }
        .startup-loading-cnt_logo {
            font-size: 14px;
            letter-spacing: -1px;
            margin: -15px 0 40px -10px;
        }
        .startup-loading-cnt_text {
            font-size: 20px;
            margin: 0 0 30px;
        }
        p {
            color: #333333;
            font-size: 12px;
        }
    </style>

    <style type="text/css">
        .loader-page {
          width: 50px;
          height: 180px;
          position: absolute;
          top: 50%;
          margin-top: -100px;
          margin-left: 75px;
          left: 50%;
        }
        .romb {
          width: 40px;
          height: 40px;
          -ms-transform: rotate(135deg) skew(20deg, 20deg);
          -webkit-transform: rotate(135deg) skew(20deg, 20deg);
          -moz-transform: rotate(135deg) skew(20deg, 20deg);
          -o-transform: rotate(135deg) skew(20deg, 20deg);
          background: red;
          border-radius: 6px;
          animation: movedown 3s infinite ease;
          -moz-animation: movedown 3s infinite ease;
          -webkit-animation: movedown 3s infinite ease;
          -o-animation: movedown 3s infinite ease;
          -ms-animation: movedown 3s infinite ease;
          position: absolute;
        }
        .romb.blue {
          background: #55bce6;
          z-index: 3;
          -webkit-animation-name: blue;
          -moz-animation-name: blue;
          -ms-animation-name: blue;
          -o-animation-name: blue;
          animation-name: blue;
        }
        .romb.red {
          background: #de7a59;
          z-index: 1;
          -webkit-animation-name: red;
          -moz-animation-name: red;
          -ms-animation-name: red;
          -o-animation-name: red;
          animation-name: red;
        }
        .romb.green {
          background: #a1cb5c;
          z-index: 2;
          -webkit-animation-name: green;
          -moz-animation-name: green;
          -ms-animation-name: green;
          -o-animation-name: green;
          animation-name: green;
        }
        .loader-page.static .romb {
          animation: none;
          -moz-animation: none;
          -webkit-animation: none;
          -o-animation: none;
          -ms-animation: none;
          -webkit-animation-name: none;
          -moz-animation-name: none;
          -ms-animation-name: none;
          -o-animation-name: none;
          animation-name: none;
        }
        .loader-page.static .romb.blue {
          top: 100px;
            background: #55bce6;
        }
        .loader-page.static .romb.red {
          top: 120px;
            background: #de7a59;
        }
        .loader-page.static .romb.green {
          top: 110px;
            background: #a1cb5c;
        }

        @-webkit-keyframes red {
          0% {
            top: 120px;
            background: #de7a59;
          }
          10% {
            top: 120px;
            background: #f2cbbf;
          }
          14% {
            background: white;
            top: 120px;
          }
          15% {
            background: white;
            top: 0;
          }
          20% {
            background: #e6e4e4;
          }
          30% {
            background: #d2d2d2;
          }
          40% {
            top: 120px;
          }
          100% {
            top: 120px;
            background: #de7a59;
          }
        }
        @keyframes red {
          0% {
            top: 120px;
            background: #de7a59;
          }
          10% {
            top: 120px;
            background: #f2cbbf;
          }
          14% {
            background: white;
            top: 120px;
          }
          15% {
            background: white;
            top: 0;
          }
          20% {
            background: #e6e4e4;
          }
          30% {
            background: #d2d2d2;
          }
          40% {
            top: 120px;
          }
          100% {
            top: 120px;
            background: #de7a59;
          }
        }
        @-webkit-keyframes green {
          0% {
            top: 110px;
            background: #a1cb5c;
            opacity: 1;
          }
          10% {
            top: 110px;
            background: #cbe0ac;
            opacity: 1;
          }
          14% {
            background: white;
            top: 110px;
            opacity: 1;
          }
          15% {
            background: white;
            top: 0;
            opacity: 1;
          }
          20% {
            background: white;
            top: 0;
            opacity: 0;
          }
          25% {
            background: #efefef;
            top: 0;
            opacity: 1;
          }
          30% {
            background: #e6e4e4;
          }
          70% {
            top: 110px;
          }
          100% {
            top: 110px;
            background: #a1cb5c;
          }
        }
        @keyframes green {
          0% {
            top: 110px;
            background: #a1cb5c;
            opacity: 1;
          }
          10% {
            top: 110px;
            background: #cbe0ac;
            opacity: 1;
          }
          14% {
            background: white;
            top: 110px;
            opacity: 1;
          }
          15% {
            background: white;
            top: 0;
            opacity: 1;
          }
          20% {
            background: white;
            top: 0;
            opacity: 0;
          }
          25% {
            background: #efefef;
            top: 0;
            opacity: 1;
          }
          30% {
            background: #e6e4e4;
          }
          70% {
            top: 110px;
          }
          100% {
            top: 110px;
            background: #a1cb5c;
          }
        }
        @-webkit-keyframes blue {
          0% {
            top: 100px;
            background: #55bce6;
            opacity: 1;
          }
          10% {
            top: 100px;
            background: #bfe8f8;
            opacity: 1;
          }
          14% {
            background: white;
            top: 100px;
            opacity: 1;
          }
          15% {
            background: white;
            top: 0;
            opacity: 1;
          }
          20% {
            background: white;
            top: 0;
            opacity: 0;
          }
          25% {
            background: white;
            top: 0;
            opacity: 0;
          }
          45% {
            background: #efefef;
            top: 0;
            opacity: 0;
          }
          100% {
            top: 100px;
            background: #55bce6;
          }
        }
        @keyframes blue {
          0% {
            top: 100px;
            background: #55bce6;
            opacity: 1;
          }
          10% {
            top: 100px;
            background: #bfe8f8;
            opacity: 1;
          }
          14% {
            background: white;
            top: 100px;
            opacity: 1;
          }
          15% {
            background: white;
            top: 0;
            opacity: 1;
          }
          20% {
            background: white;
            top: 0;
            opacity: 0;
          }
          25% {
            background: white;
            top: 0;
            opacity: 0;
          }
          45% {
            background: #efefef;
            top: 0;
            opacity: 0;
          }
          100% {
            top: 100px;
            background: #55bce6;
          }
        }
    </style>

    <style type="text/css">
        .startup-loading-cnt_progress {
            margin: 0 auto;
            width: 400px;
        }
        .asc-progress-wrapper {
            background-color: #d1d1d1;
            border-radius: 2px;
            height: 14px;
            overflow: hidden;
            position: relative;
        }
        .asc-progress-value {
            background: #439CCD;
            height: inherit;
            width: 0;
            position: absolute;
            
            background: linear-gradient(top, #57aedf, #439CCD 50%, #3B95C6 51%, #237faf);
            background: -o-linear-gradient(top, #57aedf, #439CCD 50%, #3B95C6 51%, #237faf);
            background: -moz-linear-gradient(top, #57aedf, #439CCD 50%, #3B95C6 51%, #237faf);
            background: -webkit-linear-gradient(top, #57aedf, #439CCD 50%, #3B95C6 51%, #237faf);
            -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#57aedf', EndColorStr='#237faf')";
        }
        .asc-progress-value.animated {
            width: 100%;

            -webkit-animation: 3s linear 0s normal infinite progress;
            -moz-animation: 3s linear 0s normal infinite progress;
            -o-animation: 3s linear 0s normal infinite progress;
            -ms-animation: 3s linear 0s normal infinite progress;
            animation: 3s linear 0s normal infinite progress;
        }
        .asc-progress-percent {
            color: #83888d;
            font-size: 14px;
        }

        .asc-progress-error {
            display: none;
            color: #cc3300;
            font-size: 14px;
            margin: 20px 0;
        }

        @-webkit-keyframes progress {
          0% {
            left: -100%;
          }
          10% {
            left: -80%;
          }
          20% {
            left: -60%;
          }
          30% {
            left: -40%;
          }
          40% {
            left: -20%;
          }
          50% {
            left: 0;
          }
          60% {
            left: 20%;
          }
          70% {
            left: 40%;
          }
          80% {
            left: 60%;
          }
          90% {
            left: 80%;
          }
          100% {
            left: 100%;
          }
        }
        @keyframes progress {
          0% {
            left: -100%;
          }
          10% {
            left: -80%;
          }
          20% {
            left: -60%;
          }
          30% {
            left: -40%;
          }
          40% {
            left: -20%;
          }
          50% {
            left: 0;
          }
          60% {
            left: 20%;
          }
          70% {
            left: 40%;
          }
          80% {
            left: 60%;
          }
          90% {
            left: 80%;
          }
          100% {
            left: 100%;
          }
        }
    </style>
</head>

<body>
    <div class="main-content">
        <div id="studioPageContent">
            <div class="studio-top-panel mainPageLayout">
                <ul>
                    <li class="studio-top-logo">
                        <img alt="ONLYOFFICE" src="">
                    </li>
                </ul>
            </div>
            <div class="mainPageLayout">
                <table class="mainPageTable" cellpadding="0" cellspacing="0">
                    <tbody>
                        <tr>
                            <td class="mainPageContent" valign="top">
                                <div class="startup-loading-cnt">
                                    <div id="loader">
                                        <div class="loader-page static">
                                            <div class="romb blue"></div>
                                            <div class="romb green"></div>
                                            <div class="romb red"></div>
                                        </div>
                                        <div class="startup-loading-cnt_logo"><strong>ONLYOFFICE</strong></div>
                                    </div>
                                    <p class="startup-loading-cnt_text"></p>
                                    <div class="startup-loading-cnt_progress">
                                        <div>
                                            <div class="asc-progress-wrapper">
                                                <div class="asc-progress-value animated"></div>
                                            </div>
                                            <span class="asc-progress-percent"></span>
                                        </div>
                                        <div class="asc-progress-error"></div>
                                    </div>
                                </div>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

    <script type="text/javascript">

        window.apiUrl = window.location.origin + "/api/2.0/capabilities.json";
        window.warmupUrl = window.location.origin + "/api/2.0/warmup/progress.json";

        window.textPosition = 0;
        window.textArray = [
            "The portal start up process might take some time, please wait...",
            "We are working on it.",
            "Please do not reload the page or shut down your computer."
        ];

        window.warmupAttempts = 0;

        function showText() {
            $(".startup-loading-cnt_text").text(window.textArray[window.textPosition]);

            window.textPosition++;

            if (window.textPosition == window.textArray.length)
                window.textPosition = 0;

            window.showTextTimeout = setTimeout(showText, 5000);
        };

        function getApiResponse() {
            $.ajax(window.apiUrl, {
                success: apiResponseHandler,
                error: getApiResponseDelay,
                statusCode: {
                    0: responseRedirect,
                    301: responseRedirect
                }
            });
        }

        function getApiResponseDelay() {
            window.getApiResponseTimeout = setTimeout(getApiResponse, 3000);
        }

        function apiResponseHandler(response) {
            if (response.error || response.statusCode != 200 || typeof (response) != "object") {
                getApiResponseDelay();
                return;
            }

            getWarmupResponse();
        }

        function responseRedirect() {
            if (window.apiUrl.indexOf("http:") == 0) {
                window.apiUrl = window.apiUrl.replace("http:", "https:");
                window.warmupUrl = window.warmupUrl.replace("http:", "https:");
            } else if (window.apiUrl.indexOf("https:") == 0) {
                window.apiUrl = window.apiUrl.replace("https:", "http:");
                window.warmupUrl = window.warmupUrl.replace("https:", "http:");
            }

            clearTimeout(window.getApiResponseTimeout);
            getApiResponseDelay();
        }

        function getWarmupResponse() {
            $.ajax(window.warmupUrl, {
                success: warmupResponseHandler,
                error: warmupErrorHandler
            });
        }

        function warmupResponseHandler(response) {
            var progress = response.response;

            try {
                if (typeof progress == "string") {
                    progress = JSON.parse(progress);
                }
            }
            catch (e) {
                warmupErrorHandler(null, [e.message]);
                return;
            }

            if (progress.Completed) {
                showProgress(progress.ProgressPercent);
                setTimeout(function () { window.location.href = "/"; }, 3000);
            } else {
                showProgress(progress.ProgressPercent);
                getWarmupResponseDelay();
            }
        }

        function warmupErrorHandler(params, errors) {
            if (window.warmupAttempts < 3) {
                window.warmupAttempts++;
                getWarmupResponseDelay();
            } else {
                showError(errors[0]);
            }
        }

        function getWarmupResponseDelay() {
            window.getWarmupResponseTimeout = setTimeout(getWarmupResponse, 3000);
        }

        function showProgress(progress) {
            $(".asc-progress-value").removeClass("animated").animate({ "width": progress + "%" }, 3000, "linear");
            if (progress > 0) {
                clearTimeout(window.showTextTimeout);
                $(".startup-loading-cnt_text").text(window.textArray[0]);
            }
        }

        function showError(error) {
            $(".asc-progress-error").text(error).show();
        }

        showText();
        getApiResponse();

    </script>
</body>

</html>
